import React from 'react';
import { createPortal } from 'react-dom';

const PortalDialog = (props) => {
  return createPortal(
    <div className="dialog">
      PortalDialog-loading
      {props.children}
      <button
        type="button"
        onClick={() => props.onClose()}
      >
        close
      </button>
    </div>,
    document.body
  );
};

export default PortalDialog;
